#!/usr/bin/env python 
# -*- coding:utf-8 -*-
"""
@Time:2021/12/26 7:02 下午"
@Author:lydia_liu"
@File:addcontent_page.py
@function:
"""
from appium.webdriver.common.mobileby import MobileBy

from po_app_object.app_wechat_page.base.base import BasePage
from po_app_object.app_wechat_page.page.addinput_page import AddInputPage


class AddContentPage(BasePage):
    inputadd_element = (MobileBy.XPATH, '//*[@text="手动输入添加"]')
    toast_element = (MobileBy.XPATH, '//*[@class="android.widget.Toast"]')
    #点击手动输入添加
    def click_addcontent(self):
        self.find_click(*self.inputadd_element)
        self.log_info("点击手动输入添加按钮")
        return AddInputPage(self.driver)

    def get_atrr(self):

        result = self.find(*self.toast_element).get_attribute('text')
        self.log_info("获取是否添加成功toast")
        return result

